<?php
error_reporting(0);
$isadmin=1;
include '../../comm/config.php';
include '../../comm/checkpostandget.php';
include '../check.php';
$id=$_POST['id']; 
$typename=$_POST['typename']; 
$typecode=$_POST['typecode']; 
$oldtypecode=$_POST['oldtypecode']; 
$wz=$_POST['wz'];
$sj= date("Y-m-d H:i:s");  

$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
     die(ERR_DB);
}
mysql_select_db($dbname);

mysql_query("set names utf8");

$q = "update ".$BIAOTOU."malltype set typename='".$typename."',typecode='".$typecode."',sort='".$wz."' where id='".$id."';";
mysql_query($q);
if($oldtypecode!=$typecode){
	$q = "update ".$BIAOTOU."mall set catid='".$typecode."' where catid='".$oldtypecode."';";
	mysql_query($q);
}

header('Location: mall_type.php');     

mysql_close($link);

?>
